from django.db import models
class Department(models.Model):
    title = models.CharField(max_length=100)

class Employee(models.Model):
    first_name = models.CharField(max_length=100)
    last_name = models.CharField(max_length=100)
    # null=True, model.create可以不传。
    # blank=True, 生成表单中没有检验空。
    department = models.ForeignKey(Department,on_delete=models.CASCADE,null=True)
    birthdate = models.DateField(null=True, blank=True)
